#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：16.循环语句.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-09-22 15:03
'''

# 重复打印
i = 0
while i < 100:
    print("真厉害...")
    i+=1

# 计算1~100的累加和

i = 0
sum = 0;
while i <= 100:
    sum += i
    i+=1

print(f"1~100的累计和值为：{sum}")

# 计算1~100的偶数累计和
i = 1
sum = 0;
while i <= 100:
    if i%2 == 0:
        sum += i
    i+=1

print(f"计算1~100的偶数累计和值为：{sum}")

# 计算1~100的能被3整除且还能被7整除的数累计和
i = 1
sum = 0;
while i <= 100:
    if i%3 == 0 and i%7 == 0:
        sum += i
    i+=1

print(f"计算1~100的能被3整除且还能被7整除的数累计和值为：{sum}")